using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using Impact.Web.Foundation.Handlers;
using System.Web;

namespace Impact.Web.Foundation
{
    internal class Maintenance
    {

        private static DateTime lastRun = DateTime.MinValue;

        internal static void Check()
        {
            DateTime nextRun = lastRun.AddDays( 1.0 );
            if ( DateTime.Now > nextRun )
            {

                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork += new DoWorkEventHandler(DoWork);
                worker.RunWorkerAsync( HttpContext.Current );

                lastRun = DateTime.Now;
            }
        }

        static void DoWork( object sender, DoWorkEventArgs e )
        {
        }
    }
}
